package com.opensource.component.commom;

import com.opensource.component.commom.http.HttpClientUtils;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.apache.http.Header;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.message.BasicHeader;

/**
 * @author zhanglong and since  2019/12/30  4:04 ����
 */
public class MainExecute {

    /**
     * description
     */
    public static void main(String[] args ) {
        Header[] headers = new Header[]{
            new BasicHeader("Content-Type", "application/json"),
        };
        CredentialsProvider provider = new BasicCredentialsProvider();
        // Create the authentication scope
        AuthScope scope = new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT,
            AuthScope.ANY_REALM);
        // Create credential pair
        UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("csxzt_q",
            "1234qwer");
        // Inject the credentials
        provider.setCredentials(scope, credentials);
        Map<String, String> params = new HashMap<>();
        params.put("applyUserAccount","zhangsan");
        params.put("applyEmpNumber","123456");
        params.put("payType","NOR_PAY");
        params.put("payMethod","TRANSACTION");
        params.put("currencyCode","CNY");
        params.put("currencyName","�����");
        params.put("payAmount","1000.00");
        params.put("expectPayDate","2019-07-24");
        params.put("purpose","乱码了");
        params.put("summary","乱码了");
        params.put("payDesc","乱码了");
        params.put("ouCode","1234");
        params.put("isUrgent","N");
        params.put("isPublic","Y");
        params.put("vendorType","UNEMPLOYEE");
        params.put("vendorCode","1234");
        params.put("vendorName","乱码了");
        params.put("vendorSiteCode","1234");
        params.put("vendorSiteName","乱码了");
        params.put("receiver","乱码了");
        params.put("receiverEn","");
        params.put("bankAccount","6222734343343433434343");
        params.put("bankName","乱码了");
        params.put("bankCode","12345678");
        params.put("bankAddress","");
        params.put("country","");
        params.put("provice","");
        params.put("city","");
        params.put("bankType","");
        params.put("payBankAccount","");
        params.put("payBankName","");
        params.put("payBankAccountName","");
        params.put("customerCode","");
        params.put("customerName","");
        params.put("swiftCode","");
        params.put("proxyUser","乱码了");
        params.put("sourceSystem","乱码了");
        params.put("sourceOrderType","DSFDSFDS");
        params.put("sourceOrderId","12345678");
        params.put("sourceOrderCode","ABC12345678");
        params.put("sourceOrderLineId","1");
        params.put("sourceOrderUrl","https://www.baidu.com");
        params.put("profitCode","12345");

        final String responseContext;
        try {
            responseContext = HttpClientUtils
                .doPost("http://10.1.41.232:50000/RESTAdapter/public/FS0008", params, provider, headers);
        } catch (IOException e) {
        }

    }



}
